package com.dense.kuiniu.bookborrow.xjSetting.manager;

import com.dense.kuiniu.bookborrow.App;
import com.dense.kuiniu.bookborrow.xjSetting.config.ShareKeyConfig;
import com.dense.kuiniu.bookborrow.xjSetting.utils.SharePreferceUtil;

public class YuyinUtils {
    private static YuyinUtils install;

    public static YuyinUtils getInstall(){
        if (install==null){
            synchronized (YuyinUtils.class){
                if (install==null){
                    install=new YuyinUtils();
                    install.getYuyinPlay();
                }
            }
        }
        return install;
    }

    private boolean playYuyin=true;


    public boolean getYuyinPlay(){
        playYuyin=SharePreferceUtil.getInstance(App.getContext()).getBoolean(ShareKeyConfig.START_YUYIN,true);
        return playYuyin;
    }
    public void setYuyinPlay(boolean play){
        playYuyin=play;
        SharePreferceUtil.getInstance(App.getContext()).setCache(ShareKeyConfig.START_YUYIN,playYuyin);
    }

    /**
     * 语音播报
     * @param grade 排序，默认0,0
     * @param type 播报类型，0-10为系统专用,0为没有类型，存在类型的情况下相同类型进行去重播报
     * @param txt 语音文字播报
     */
    public void onPlay(int grade,int type,String txt ){
        if (playYuyin) {

        }
    }
}
